package com.nimlib.msg;

import com.alibaba.fastjson.JSONObject;
import com.netease.nimlib.sdk.msg.attachment.MsgAttachment;

/**
 * 房源信息
 */
public class HouseInfoMessage implements MsgAttachment {

    public static int TYPE = 7;

    private int type = TYPE;


    public int getType() {
        return type;
    }

    private HouseInfo data;

    public HouseInfo getData() {
        return data;
    }

    public void setData(HouseInfo data) {
        this.data = data;
    }

    @Override
    public String toJson(boolean send) {
        JSONObject json = new JSONObject();
        json.put("type",this.type);
        JSONObject data = new JSONObject();
        data.put("title",this.data.title);
        data.put("subTitle",this.data.subTitle);
        data.put("houseCode",this.data.houseCode);
        json.put("data",data);
        return json.toJSONString();
    }


    public static class HouseInfo{
        private String title;
        private String subTitle;
        private String houseCode;

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getSubTitle() {
            return subTitle;
        }

        public void setSubTitle(String subTitle) {
            this.subTitle = subTitle;
        }

        public String getHouseCode() {
            return houseCode;
        }

        public void setHouseCode(String houseCode) {
            this.houseCode = houseCode;
        }
    }
}
